package com.yamanyar.weebill.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.yamanyar.weebill.domain.Role;

/**
 * Services for Role. These services uses data access objects for persistence
 * operations or any kind of calculation that might be needed. Created in Jun
 * 28, 2008.
 * 
 * @author Kaan Yamanyar
 */
public interface RoleService {

	/**
	 * Persists given role.
	 * 
	 * @param role
	 */
	@Transactional
	public void createNew(Role role);

	/**
	 * 
	 * @return All the roles in the system.
	 */
	public List<Role> findAll();

	/**
	 * Returns a role with the given name. Please note that role name is an
	 * unique property. If there isn't such an role with the given name,
	 * <code>null</code> is returned.
	 * 
	 * 
	 * @param name
	 *            of the desired role.
	 * @return role with the given name or <code>null</code>.
	 */
	public Role findByName(String name);

	/**
	 * Return required Role with given id. 
	 * 
	 * @param id if of the Role required
	 * @return The required role
	 */
	public Role getRoleWithID(Long id);

}
